
from re_common.baselibrary.utils.my_abc.better_abc import ABCMeta, abstract_attribute  # see below


class AbstractFoo(metaclass=ABCMeta):
    def __init__(self):
        pass

    @abstract_attribute
    def bar(self):
        pass

    def print(self):
        print(self.bar)


class Foo(AbstractFoo):
    def __init__(self):
        super().__init__()
        self.bar = 3


class BadFoo(AbstractFoo):
    def __init__(self):
        super().__init__()
        pass

# 但是如果 AbstractFoo 中存在 self.bar 即使不重写也不会报错
Foo().print()
